package test00.test05.t01.demo01;
import test00.test05.t01.Student;
import java.util.function.Supplier;

import java.util.stream.Stream;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
/**
 * @Author lzp
 * @Date 2024-04-10
 */
public class Test {

    public static void main(String[] args) {

//        List<Student> list = new ArrayList<>();
//        list.add(new Student("小宏",11));
//        list.add(new Student("傻椿",12));
//        list.add(new Student("黑佬",13));
//
//        Stream<Student> stream1 = list.stream();
//        Optional<Student> min = stream1.min((a,b)->Integer.compare(a.getAge(), b.getAge()));
//        System.out.println(min.toString());
//        System.out.println(min.orElse(null));

        Student[] stu ={
                new Student("张三",10),
                new Student("李四",20),
                new Student("王五",30)
        };

        Supplier<Student> supplier =new SupplierImpl(stu);
        System.out.println(supplier.get());


    }

}
